#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::mousePressEvent(QMouseEvent *e)
{
    switch(e->button())
    {
        case Qt::LeftButton:
            qDebug("left button");
            qDebug("x : %d ,y : %d" ,e->x() , e->y());
        break;
        case Qt::RightButton:
            qDebug("right button");
        break;
        case Qt::MidButton:
            qDebug("middle button");
        break;
    }
}


void Dialog::keyPressEvent(QKeyEvent *e)
{
    switch(e->key())
    {
        case Qt::Key_Up:
            qDebug("up key pressed");
        break;
        case Qt::Key_Down:
            qDebug("down key pressed");
        break;
        case Qt::Key_Left:
            qDebug("left key pressed");
        break;
        case Qt::Key_Right:
            qDebug("right key pressed");
        break;
    }
}
